<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ page import="com.zx.oa.utils.PageSupport" %>
<%@ page import="com.zx.oa.entity.Work" %>
<%@ include file="../common/header.jsp" %>

<!-- appInfoList页面开始 -->
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_content">
                <br/>
                <form id="demo-form2" data-parsley-validate
                      class="form-horizontal form-label-left"
                      method="post" action="workServlet.do?param=cha">
                    <!-- 隐藏域，用于传递分页的当前页号 -->
                    <input type="hidden" name="param" value="cha"/>
                    <!-- 这个pageIndex隐藏域是当前页号-->
                    <input type="hidden" name="pageIndex" value="1"/>
                    <ul style="list-style:none;display:inline-block;;">
                        <li>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">培训专业</label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <select name="queryMajor" id="queryMajor"
                                            class="form-control col-md-7 col-xs-12">
                                        <option value="">---请选择---</option>
                                        <c:forEach var="workMajor" items="${workMajorList}">
                                            <option
                                                    <c:if test="${param.queryMajor eq workMajor.major}">
                                                        selected
                                                    </c:if>
                                                    value="${workMajor.major}">
                                                    ${workMajor.major}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">部门 </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <select name="queryClassName" id="queryClassName"
                                            class="form-control col-md-7 col-xs-12">
                                        <option value="">---请选择---</option>
                                        <c:forEach var="workClassName" items="${workClassNameList}">
                                            <option
                                                    <c:if test="${param.queryClassName eq workClassName.className}">
                                                        selected
                                                    </c:if>
                                                    value="${workClassName.className}">
                                                    ${workClassName.className}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </li>

                        <li>
                            <div class="form-group">
                                <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                    <button type="submit" class="btn btn-primary"
                                            class="btn btn-success">查&nbsp;&nbsp;&nbsp;&nbsp;询
                                    </button>
                                </div>
                            </div>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </div>

    <!-- 表格 -->
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <span>请选择学生学号点击按钮登记考勤：</span>
<%--            <a href="${ctx}/workServlet.do?param=upset&&ckstatu='正常'" name="workPut" class="btn btn-success btn-sm">正常</a>--%>
<%--            <a href="${ctx}/workServlet.do?param=upset&&ckstatu='迟到'" name="workPut" class="btn btn-success btn-sm">迟到</a>--%>
<%--            <a href="${ctx}/workServlet.do?param=upset&&ckstatu='旷课'" name="workPut" class="btn btn-success btn-sm">旷课</a>--%>
<%--            <a href="${ctx}/workServlet.do?param=upset&&ckstatu='早退'" name="workPut" class="btn btn-success btn-sm">早退</a>--%>
            <input type="submit" name="workPut" value="正常" class="btn btn-success btn-sm" >
            <input type="submit" name="workPut" value="迟到" class="btn btn-success btn-sm" >
            <input type="submit" name="workPut" value="旷课" class="btn btn-success btn-sm" >
            <input type="submit" name="workPut" value="早退" class="btn btn-success btn-sm" >
            <table id="datatable" class="table table-striped table-bordered">
                <thead>
                <tr>
                    <th>选择学号</th>
                    <th>培训专业</th>
                    <th>班级名称</th>
                    <th>学生姓名</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="work" items="${requestScope.workList}">
                    <tr>
                        <td><input name="studentId" type="checkbox" value=${work.studentId} />${ work.studentId }</td>
                        <td>${ work.major }</td>
                        <td>${ work.className }</td>
                        <td>${ work.studentName }</td>
                    </tr>
                </c:forEach>
                </tbody>
                <tr>
                    <td colspan="10" style="text-align: right;">
				   	  <span>共有${pageInfo.totalCount}条数据,
				   	  ${pageInfo.currentPageNo}/${pageInfo.totalPageCount}页</span>
                        <a href="javascript:page_nav(document.forms[0],1);">首页</a>&nbsp;
                        <a href="javascript:page_nav(document.forms[0],${pageInfo.currentPageNo}-1);">上一页</a>&nbsp;
                        <a href="javascript:page_nav(document.forms[0],${pageInfo.currentPageNo}+1);">下一页</a>&nbsp;
                        <a href="javascript:page_nav(document.forms[0],${pageInfo.totalPageCount});">末页</a>&nbsp;
                    </td>
                </tr>
            </table>
            <c:if test="${ empty workList }">
                <h3>没有学生信息</h3>
            </c:if>
        </div>
    </div>
    <!-- 表格 -->
    <!-- 分页 -->
</div>

<!-- appInfoList页面结束 -->
<!-- /page content -->
<%@ include file="../common/footer.jsp"%>
<script src="${ctx}/statics/localjs/workUpset.js"></script>
